<%@ page contentType="text/html; charset=utf-8"%>
<%@ include file="../../../common/include.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<jsp:include page="../../../common/head.jsp">
			 <jsp:param name="_spPage" value="true"/>
			 <jsp:param name="_useCalendar" value="true"/>
			 <jsp:param name="_useReport" value="true"/>
			 <jsp:param name="_useSuggest" value="true"/>
			 <jsp:param name="_useOrgSuggest" value="true"/>
			 <jsp:param name="_useEmpSuggest" value="true"/>
		</jsp:include>

		<title>员工信息管理</title>
		<script language="JavaScript">
			function addData()
			{
				window.location.href="addEmployee.do";
			}  
			function exportData()
			{
				xjReportEngine.ctx="${ctx}";
				xjReportEngine.exportReport("form1","员工管理");
			}
			function importData()
			{
				xjReportEngine.ctx="${ctx}";
				xjReportEngine.importReport("员工管理");
			}
			function editData(employeeId)
			{
				window.location.href="updateEmployee.do?employeeId="+employeeId;
			}
			function deleteData(employeeId)
			{
				if(confirm("确认删除？"))
					window.location.href="deleteEmployee.do?employeeId="+employeeId;
			}
			function queryInfo()
			{
				var o = document.getElementsByName("onJobSituation");
				var str = "";
				for(var i=0;i<o.length;i++)
				{
					if(o[i].checked)
					{
						str+=o[i].value+",";
					}
				}
				if(str.length>0)
					str = str.substring(0,str.length-1);
				$("#onJobSituationId").val(str);
			}
			$.ready = function()
			{
				$("#companyName").getSuggest({
					jsonData : orgs,
					formatStr : ["orgId","orgName"],
					matchStr : ["jp","qp","orgId"],
					selectedMatch : new Array(["companyName","orgName"],["companyId","orgId"])
				});
				$("#employeeName").getSuggest({
					jsonData : emps,
					formatStr : ["employeeCode","employeeName"],
					matchStr : ["jp","qp","employeeCode"],
					selectedMatch : new Array(["employeeName","employeeName"],["employeeCode","employeeCode"])
				});
			}

		</script>
	</head>
	<body>
	<form action="listEmployee.do" name="form1" id="form1" method="post" onsubmit="queryInfo()">
	<div id="body_div">
	<w:ShowTitle name="员工管理" useSubmitKey="false">
	<w:TitleButton funcName="查询" onClickFunction="_queryDivBg(this)" urlImg="${ctx}/images/main/query.png"/>
	<w:TitleButton funcName="添加" onClickFunction="addData()" urlImg="${ctx}/images/main/add.png"/>
	</w:ShowTitle>
	<div id="body_content">
				<div id="queryDiv">
			<table width="100%" border="0">
				<tr>
					<td colspan="4" class="td_title">
						员工信息查询
					</td>
				</tr>
				<tr>
					<td width="90">员工编号</td>
					<td class="left_align"><input type="text" name="empEmployee.employeeCode" id="employeeCode" value="${empEmployee.employeeCode}"/></td>
					<td>员工姓名</td>
					<td class="left_align"><input type="text" name="empEmployee.employeeName" id="employeeName" value="${empEmployee.employeeName}"/></td>
				</tr>
				<tr>
					<td>身份证号</td>
					<td class="left_align"><input type="text" name="empEmployee.idNumber" value="${empEmployee.idNumber}"/></td>
					<td>性别</td>
					<td class="left_align">
						<w:select name="empEmployee.employeeGender" value="${empEmployee.employeeGender}">
							<w:option optionLabel="请选择" optionValue=""></w:option>
							<w:option optionLabel="男" optionValue="男"></w:option>
							<w:option optionLabel="女" optionValue="女"></w:option>
						</w:select>
					</td>
				</tr>
				<tr>
					<td>地区</td>
					<td class="left_align">
						<w:select name="empEmployee.areaId" value="${empEmployee.areaId}">
							<w:option optionLabel="请选择" optionValue=""></w:option>
							<w:options options="${CodeDict}" optionLabel="codeName" optionValue="codeId" filterFieldName="parentCodeId" filterFieldValue="001"></w:options>
						</w:select>
					</td>
					<td>事业部</td>
					<td class="left_align">
              			<w:select name="empEmployee.areaDeptId" value="${empEmployee.areaDeptId}">
							<w:option optionLabel="请选择" optionValue=""></w:option>
							<w:options options="${CodeDict}" optionLabel="codeName" optionValue="codeId" filterFieldName="parentCodeId" filterFieldValue="002"></w:options>
						</w:select>
           			</td>  
				</tr>
				<tr>
					<td>销售分线</td>
					<td class="left_align">
						<w:select name="empEmployee.saleDeptId" value="${empEmployee.saleDeptId}">
							<w:option optionLabel="请选择" optionValue=""></w:option>
							<w:options options="${CodeDict}" optionLabel="codeName" optionValue="codeId" filterFieldName="parentCodeId" filterFieldValue="003"></w:options>
						</w:select>
					</td>
					<td></td>
					<td class="left_align">
           			</td>  
				</tr>
				<tr>
					 <td colspan="4">
						<input name="button" type="submit" class="btn_standard" onclick="" value="查询" />
						<input name="button" type="button" class="btn_standard" onclick="_cancelQuery()" value="取消" />
					</td>
				</tr>
			</table>
			</div>	
				<table width="100%" class="listTable">
					<tr>
						<td width="80" class="td_title">员工代码</td>
						<td width="80" class="td_title">姓名</td>
						<td class="td_title" width="40">性别</td>
						<td class="td_title" width="80">在岗情况</td>
						<td class="td_title" width="80">人员身份</td>
						<td class="td_title" width="80">出生日期</td>
						<td class="td_title" width="120">身份证号</td>
						<td class="td_title" >地区</td>
						<td class="td_title" >事业部</td>
						<td class="td_title" >销售分线</td>
						<td class="td_title" width="70">操作</td>
					</tr>
					<c:forEach items="${datalist}" var="obj">
						<tr>
							<td width="50">${obj.employeeCode}</td>
							<td width="50">${obj.employeeName}</td>
							<td class="left_align">${obj.employeeGender}</td>
							<td class="left_align">${obj.onJobSituation}</td>
							<td class="left_align"><w:CodeDictOut value="${obj.personnelIdentification}"></w:CodeDictOut></td>
							<td class="left_align"><fmt:formatDate value='${obj.employeeBirthday}' pattern="yyyy-MM-dd" /></td>
							<td class="left_align">${obj.idNumber}</td>
							<td class="left_align">${obj.areaName}</td>
							<td class="left_align">${obj.areaDeptName}</td>
							<td class="left_align">${obj.saleDeptName}</td>
							<td>
								<a href="#" onclick="javascript:editData('${obj.employeeId}')">修改</a>
								<a href="#" onclick="javascript:deleteData('${obj.employeeId}')">删除</a>
							</td>
						</tr>
					</c:forEach>
				</table>
				<w:spPage />
			</div>
		</div>	
		</form>
	</body>
</html>